package com.huixh.train.common.req;

/**
 * @author huixh
 */
public class PageReq {
    private Integer pageNum;

    private Integer pageSize;


    public PageReq() {
        checkPageParams();
    }

    public PageReq(Integer pageNum, Integer pageSize) {
        this.pageNum = pageNum;
        this.pageSize = pageSize;
        checkPageParams();
    }

    public Integer getPageNum() {
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public void checkPageParams() {
        if (pageNum == null || pageNum < 1) {
            pageNum = 1;
        }
        if (pageSize == null || pageSize < 1) {
            pageSize = 15;
        }
    }
}
